<script type="javascript">

    var timeout = '{{isset($timeout) ? $timeout : 0}}';

    setTimeout(function () {
        window.opener = null;
        window.close();
    }, timeout);
</script>